RWTH - Mindstorms NXT Toolbox

NXT_ResetMotorPosition

Resets NXT internal counter for specified motor, relative or absolute counter

Contents

Syntax

NXT_ResetMotorPosition(port, isRelative)

NXT_ResetMotorPosition(port, isRelative, handle)

Description

NXT_ResetMotorPosition(port, isRelative) resets the NXT internal counter of the given motor port. The value port can be addressed by the symbolic constants MOTOR_A, MOTOR_B, MOTOR_C analog to the labeling on the NXT Brick. The boolean flag isRelative determines the relative (BlockTachoCount) or absolute counter (RotationCount).

NXT_ResetMotorPosition(port, handle) uses the given NXT connection handle. This should be a struct containing a serial handle on a PC system and a file handle on a Linux system.

If no NXT handle is specified the default one (COM_GetDefaultNXT) is used.

For more details see the official LEGO Mindstorms communication protocol.

Examples

   NXT_ResetMotorPosition(MOTOR_B, true);
   handle = COM_OpenNXT('bluetooth.ini','check');
   NXT_ResetMotorPosition(MOTOR_A, false, handle);

See also

COM_GetDefaultNXT

Signature